
class SearchModel{
  final List<SearchItem> data;
  String keyword;

  SearchModel({required this.data,this.keyword=''});

  factory SearchModel.fromJson(Map<String, dynamic> json) {
    var dataJson = json['data']as List;
    List<SearchItem> data1 = dataJson.map((e) => SearchItem.fromJson(e)).toList();
    SearchModel model =SearchModel(data: data1,);
    return model;
   
  }

}

class SearchItem {
  late String word;
  late String type;
  late String districtname;
  late String url;

  SearchItem(this.url,this.word, this.type, this.districtname);

  factory SearchItem.fromJson(Map<String, dynamic> json) {
    String word1 = json['word'];
    String type1 = json['type'];
    String districtname1 = json['districtname'];
    String url1 = json['url'];
    return SearchItem(url1,word1,type1, districtname1);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['word'] = this.word;
    data['type'] = this.type;
    data['districtname'] = this.districtname;
    data['url'] = this.url;
    return data;
  }
}